const path = require('path');
module.exports = {
  devServer: {
    port: 80,
    proxy: {
      '/api': {
        target: "http://127.0.0.1:48080",
        pathRewrite: { "^/api": "" },
        ws: true,
        changeOrigin: true
      }
    }
  },
  productionSourceMap: false,
  lintOnSave: false,
  chainWebpack: (config) => {
    const dir = path.resolve(__dirname, 'src/assets/icons');
    config.module.rule('svg-sprite').test(/\.svg$/).include.add(dir).end().use('svg-sprite-loader').loader('svg-sprite-loader').options({ extract: false }).end()
    config.plugin('svg-sprite').use(require('svg-sprite-loader/plugin'), [{ plainSprite: true }])
    config.module.rule('svg').exclude.add(dir)
  }
}
